package cn.coder.jdbc2.core;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

import cn.coder.jdbc2.util.ClassUtil;

public class ConnectionPool {

	private Properties config;

	public ConnectionPool(Properties prop) {
		this.config = prop;

		ClassUtil.getClazz(prop.getProperty("driver"));

		init();
		// dataSource.setDriverClassName();
		// dataSource.setUrl(prop.getProperty("url"));
		// dataSource.setUsername(prop.getProperty("username"));
		// dataSource.setPassword(prop.getProperty("password"));
	}

	private void init() {
		// TODO Auto-generated method stub

	}

	public Connection getConnection() throws SQLException {
		// TODO Auto-generated method stub
		return DriverManager.getConnection(this.config.getProperty("url"), this.config.getProperty("username"),
				this.config.getProperty("password"));
	}

}
